﻿using System;
using System.IO;
using Bookvar.ObjectModel;

namespace Bookvar.ServiceModel
{
    public interface IPersistenceService
    {
        event EventHandler<SavingEventArgs> Saving;

        bool SaveMapToPersistence( MindMap map );

        MindMap LoadMapFromPersistence( Guid mapId );

        Stream LoadFileResourceFromPersistence( Guid mapId, IFileResource resource );

        void RemoveFileResourceFromPersistence( Guid mapId, IFileResource resource );

        void SaveFileResourceToPersistence( Guid mapId, IFileResource resource, Stream resourceStream );
    }
}